Skip to content

Make sure that moderators can interact with trashcans and restrict paginator usage#1358

Merged
HassanAbouelela merged 6 commits into
masterfrom
trashcan-mods
Jan 29, 2021
Merged

Make sure that moderators can interact with trashcans and restrict paginator usage#1358
HassanAbouelela merged 6 commits into
masterfrom
trashcan-mods

Conversation

@Akarys42
Copy link
Copy Markdown
Contributor

  • Add an override for moderation roles in wait_for_deletion 5e93396
  • Restrict the paginator usage to ctx.author by default and add an override for mods c25929c

The `allow_moderation_roles` bool can be specified to allow anyone with a role in `MODERATION_ROLES` to delete
    the message.
@Akarys42 Akarys42 added t: feature New feature or request p: 3 - low Low Priority a: utility Related to utility commands: (bot, eval, extensions, jams, reminders, snekbox, utils) labels Jan 16, 2021
@coveralls
Copy link
Copy Markdown

coveralls commented Jan 17, 2021

Coverage Status

Coverage decreased (-0.004%) to 56.625% when pulling 9b2d71f on trashcan-mods into 3d014d9 on master.

Copy link
Copy Markdown

@Inheritanc-e Inheritanc-e left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one small change.

Comment thread bot/pagination.py
Comment thread bot/pagination.py
Comment thread bot/pagination.py Outdated
or user_.id == restrict_to_user.id
user_.id == restrict_to_user.id
# The reaction was by a moderator
or any(role.id in MODERATION_ROLES for role in user_.roles)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe the paginator is inherently restricted to guilds. Therefore, this event may get a User which doesn't have roles.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point. Fixed in 46ff694 !

@Akarys42 Akarys42 requested a review from MarkKoz January 24, 2021 16:40
@HassanAbouelela HassanAbouelela merged commit 0bd9ae5 into master Jan 29, 2021
@HassanAbouelela HassanAbouelela deleted the trashcan-mods branch January 29, 2021 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: utility Related to utility commands: (bot, eval, extensions, jams, reminders, snekbox, utils) p: 3 - low Low Priority t: feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants